#include <jsoncpp/json/json.h>
#include <string>
#include <iostream>

int main(){

    int x = 1;
    int y = 2; 
    char oper = '+'; 
    Json::Value root;
    root["x"] = x;
    root["y"] = y;
    root["oper"] = std::string(1, oper);

    Json::FastWriter w;
    std::string s = w.write(root);

    std::cout << s << std::endl;

    Json::Value rroot;
    Json::Reader reader;
    reader.parse(s, rroot);

    int _x = rroot["x"].asInt();
    int _y = rroot["y"].asInt();
    std::string _o = rroot["oper"].asCString();

    std::cout << _x << " " << _y << " " << _o << std::endl;
    return 0;
}